package com.victor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.victor.entity.comments.CommentPhoto;
import com.victor.entity.comments.Comments;
import com.victor.entity.praise.CommentsPraise;
import com.victor.entity.toreport.ToReport;
import com.victor.entity.toreport.ToreportPhoto;

@Mapper
public interface CommentsDao {
	/**
	 * 查询评论
	 * @param type
	 * @param pid
	 * @param uid
	 * @return
	 */
	List<Comments> selCommentsByTypeAndPid(@Param("type")String type,@Param("pid") String pid,@Param("uid") String uid,@Param("flag") String flag);
	/**
	 * 根据父级id查询
	 * @param id
	 * @return
	 */
	List<Comments> selCommentsByFid(@Param("id")Integer id,@Param("uid")String uid);
		/**
	 * 根据评论id查询 评论点赞
	 * @param commentid
	 * @param uid 
	 * @return
	 */
	CommentsPraise selCommentsPriaeByCidAndUid(@Param("commentid")String commentid, @Param("uid")String uid);
	/**
	 * 添加评论点赞表
	 * @param commentsPraise
	 * @return
	 */
	boolean insertCommentspraise(CommentsPraise commentsPraise);
	/**
	 * 根据评论id 查询点赞数
	 * @param commentid
	 * @return
	 */
	String selCommentsPraiseByCid(String commentid);
	/**
	 * 删除评论点赞
	 * @param id
	 * @return
	 */
	boolean deleteCommentsPraise(Integer id);
	/**
	 * 添加评论
	 * @param comments
	 * @return
	 */
	boolean insertCommets(Comments comments);
	/**
	 * 添加城市评论图片
	 * @param commentPhoto
	 * @return
	 */
	boolean insertCommentsPhoto(CommentPhoto commentPhoto);
	/**
	 * 添加举报
	 * @param toReport
	 * @return
	 */
	boolean insertToReport(ToReport toReport);
	/**
	 * 添加图片
	 * @param toreportPhoto
	 * @return
	 */
	boolean insertToReportPhoto(ToreportPhoto toreportPhoto);

}
